import Vue from 'vue'
import Vuex from 'Vuex'
import * as types from './types'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        token: null,
      },
      mutations: {
        [types.LOGIN]: (state,data)=> {
            localStorage.token=data
          state.token=data
        },
        [types.LOGOUT]: (state,data)=> {
            localStorage.removeItem('token')
            state.token=null
          }
      }
})
